﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QRCodeTool
{
    public partial class FrmMessage : Form
    {
        string msg = "";

        bool? showResult = null;

        public FrmMessage(string msg):this() {
            this.msg = msg;
            tbMessage.Text = "\r\n\r\n    " + msg;
            this.ActiveControl = this.btnOk;
            this.TopMost = true;
        }

        public FrmMessage(string msg, bool? result):this(msg) { 
            showResult = result;
        }
        public FrmMessage()
        {
            InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void FrmMessage_Load(object sender, EventArgs e)
        {

        }

        private void FrmMessage_Shown(object sender, EventArgs e)
        {
            if(this.showResult == null) {
                this.la.Visible = false;
                return;
            }
            this.la.Visible=true;
            if (this.showResult == false) { 
                this.la.ForeColor = Color.Red;
            } else { 
                this.la.ForeColor=Color.Green;
            }
        }
    }
}
